#define _CRT_SECURE_NO_WARNINGS 1
int missingNumber(int* nums, int numsSize) {
    int* p = (int*)malloc(4 * (numsSize + 1));
    memset(p, 0, 4 * (numsSize + 1));
    for (int i = 0; i < numsSize; i++)
    {
        p[nums[i]]++;
    }
    for (int j = 0; j <= numsSize; j++)
    {
        if (p[j] == 0)
            return j;
    }
    return 0;
}